package com.xiong.service.impl;

import com.github.pagehelper.PageHelper;
import com.xiong.dao.StudentDao;
import com.xiong.pojo.Student;
import com.xiong.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 熊宇
 * @date 2022/4/29 15:36
 * @description
 */
@Service
public class StudentServiceImpl implements StudentService {

    @Autowired
    private StudentDao studentDao;

    @Override
    public List<Student> selectStudentsByName(String name,int pageNum, int pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        return studentDao.selectStudentsByName("%" + name + "%");
    }

    @Override
    public List<Student> selectStudentsBySex(Byte sex) {
        return studentDao.selectStudentsBySex(sex);
    }

    @Override
    public List<Student> selectStudentsByGrade(Integer grade) {
        return studentDao.selectStudentsByGrade(grade);
    }
}
